package com.example.supernote.data.trash.impl

import com.example.supernote.data.trash.TrashRepository
import com.example.supernote.model.manager.AbstractFileComposite
import com.example.supernote.model.manager.File
import com.example.supernote.model.manager.FileProperty
import com.example.supernote.model.manager.FileType
import com.example.supernote.model.manager.Folder
import java.util.Date

class FakeTrashRepository : TrashRepository {
    private val num = 3
    override suspend fun getTrashList(): AbstractFileComposite {
        val trashRoot = Folder(
            property = FileProperty(
                name = ".", type = FileType.ROOT,
                lastModified = Date().time
            )
        )
        for (i in 1..num) {
            val file = File(
                parent = trashRoot,
                property = FileProperty(
                    name = "回收站笔记${i}",
                    type = FileType.FILE,
                    lastModified = Date().time
                )
            )
            trashRoot.addChild(file)
        }
        return trashRoot
    }
}